package com.taraslaba.polvisachecker.server;

import java.io.IOException;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CheckVisaServlet extends HttpServlet {
	private static final Logger logger = Logger.getLogger(CheckVisaServlet.class.getName());
		
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		logger.entering(CheckVisaServlet.class.getName(), "doGet");
		
		String scheduleInfo = CheckVisaUtil.getVisaShceduleInfo();
		ScheduleInfoHistoryDatastore.logScheduleInfo(scheduleInfo);
		
		resp.setContentType("text/html");
		resp.setCharacterEncoding("UTF-8");
		resp.getWriter().write(scheduleInfo);
		
		logger.exiting(CheckVisaServlet.class.getName(), "doGet");
	}
}